package com.yzt.dynamicmodule.dialog;

import android.view.View;

import com.yzt.dynamicmodule.R;

import com.yzt.zhuju.dialog.BottomBaseDialog;

/**
 * 作者：bobwang
 * 创建时间：2024-01-01 00:35:16
 * 描述：
 */
public class IndexShareDialog extends BottomBaseDialog {
    @Override
    public int getLayoutRes() {
        return R.layout.dialog_share;
    }

    @Override
    public void bindView(View v) {

        findViewById(R.id.img_close).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                dismissAllowingStateLoss();
            }
        });

        findViewById(R.id.tv_share_friend).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                if (listener != null) {
                    listener.onShare(1);
                }
                dismissAllowingStateLoss();
            }
        });

        findViewById(R.id.tv_share_wechat).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                if (listener != null) {
                    listener.onShare(2);
                }
                dismissAllowingStateLoss();
            }
        });
        findViewById(R.id.tv_share_pyq).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                if (listener != null) {
                    listener.onShare(3);
                }
                dismissAllowingStateLoss();
            }
        });
    }

    private OnSelectOnClickListener listener;

    public void setListener(OnSelectOnClickListener listener) {
        this.listener = listener;
    }

    public interface OnSelectOnClickListener {

        void onShare(int type);
    }
}
